Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PM-14175 - Replace vault illustration on create account screen #1102

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

phil-livefront
Copy link
Collaborator

@phil-livefront phil-livefront commented Oct 31, 2024

🎟️ Tracking

PM-14175

📔 Objective

  • Replaced the vault illustration for the Bitwarden logo
  • Update the UI to start to follow the new design that is coming in v3 to save some time with that implementation. Got the go-ahead from design.
  • Figma link to updated design

📸 Screenshots

Simulator Screenshot - iPhone 16 Pro - 2024-10-31 at 19 44 45
Simulator Screenshot - iPhone 16 Pro - 2024-10-31 at 19 45 16

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

Copy link

codecov bot commented Oct 31, 2024

Codecov Report

Attention: Patch coverage is 98.76543% with 1 line in your changes missing coverage. Please review.

Project coverage is 89.37%. Comparing base (055b753) to head (f5313b4).

Files with missing lines Patch % Lines
...tion/Appearance/Modifiers/ScrollViewModifier.swift 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1102      +/-   ##
==========================================
- Coverage   89.37%   89.37%   -0.01%     
==========================================
  Files         677      677              
  Lines       42862    42883      +21     
==========================================
+ Hits        38307    38325      +18     
- Misses       4555     4558       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@phil-livefront phil-livefront marked this pull request as ready for review November 1, 2024 00:01
Comment on lines 143 to 165
private func mainContent(with proxy: GeometryProxy) -> some View {
ScrollView(showsIndicators: false) {
VStack(spacing: 0) {
if store.state.isCreateAccountFeatureFlagEnabled {
Spacer()

Image(decorative: Asset.Images.logo)
.resizable()
.scaledToFit()
.foregroundColor(Asset.Colors.iconSecondary.swiftUIColor)
.frame(maxWidth: .infinity, maxHeight: 34)
.padding(.horizontal, 12)

Spacer()
}

registrationDetails
}
.padding([.horizontal, .vertical], 16)
.frame(minHeight: store.state.isCreateAccountFeatureFlagEnabled ? proxy.size.height : 0)
}
.frame(width: proxy.size.width)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎨 I might be tempted to include the GeometryReader in this function rather than pass it it. Alternatively, keep the GeometryReader in the body, and have this return the content that should be in the scroll view. It's minor, but I think it helps to keep the geometry reader closer to where it's used when possible. You could also use the scrollView() modifier to reduce one level of indentation and get the padding and background color as free defaults.

I also wonder if we should specify some minimum padding around the image for when the content grows.

        GeometryReader { proxy in
            mainContent()
                .padding(.vertical, 16)
                .frame(minHeight: store.state.isCreateAccountFeatureFlagEnabled ? proxy.size.height : 0)
                .scrollView(addVerticalPadding: false)
        }
    private func mainContent() -> some View {
        VStack(spacing: 0) {
            if store.state.isCreateAccountFeatureFlagEnabled {
                Spacer()

                Image(decorative: Asset.Images.logo)
                    .resizable()
                    .scaledToFit()
                    .foregroundColor(Asset.Colors.iconSecondary.swiftUIColor)
                    .frame(maxWidth: .infinity, maxHeight: 34)
                    .padding(.horizontal, 12)

                Spacer()
            }

            registrationDetails
        }
    }

// MARK: View

func body(content: Content) -> some View {
ScrollView {
ScrollView(showsIndicators: showsIndicators) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matt-livefront this was also added in the other PR for the LandingView. Which over goes in first ill fix any conflicts that arise. I just didnt want to forge this on both.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also not sure why this isn't being picked up by tests... do you see anything i did wrong herE?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reasoning behind hiding the scroll indicators?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah i should have explained that, my bad. I ran this by Emily and was asked to hide them.

@@ -118,11 +118,13 @@ extension View {
///
func scrollView(
addVerticalPadding: Bool = true,
backgroundColor: Color = Asset.Colors.backgroundPrimary.swiftUIColor
backgroundColor: Color = Asset.Colors.backgroundPrimary.swiftUIColor,
showsIndicators: Bool = true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎨 Can you add this to the docs above?

Comment on lines 87 to 88
.frame(minHeight: store.state.isCreateAccountFeatureFlagEnabled ? proxy.size.height : 0)
.scrollView(showsIndicators: false)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⛏️ I think if we fix the frame to the height of the view, we need to remove the padding that scrollView adds and manually add it before the frame modifier. Otherwise, the content size is larger than the scroll bounds and it will scroll slightly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did i fix this right? my eyes are being deceiving right now... the min spacer height i think is messing with me. Did i add a double top padding here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants